import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class demo1  {
    static StringBuilder fun1(String s1,String s2) {
        Set<Character> set = new HashSet<>();
        for(int i=0;i<s2.length();i++) {
            set.add(s2.charAt(i));
        }
        StringBuilder ret=new StringBuilder();
        for(int i=0;i<s1.length();i++) {
            if(!set.contains(s1.charAt(i))) {
                ret.append(s1.charAt(i));
            }
        }
        return ret;
    }
    public static void main(String[] args) {
        String s1= new String();
        String s2=new String();
        Scanner scanner = new Scanner(System.in);
        s1=scanner.nextLine();
        s2=scanner.nextLine();
        StringBuilder ret = fun1(s1,s2);
        System.out.println(ret);
    }
}
